package com.itheima.business.controller;
import com.itheima.business.domain.dto.UserLoginDto;
import com.itheima.business.domain.vo.UserLoginVo;
import com.itheima.business.service.ISysUserService;
import com.itheima.response.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Tag(name = "系统用户登录")
@RequiredArgsConstructor
@RestController
@RequestMapping("/user")
public class UserLoginController {

    private final ISysUserService sysUserService;

    /***
     * 登录
     */
    @Operation(description = "登录方法")
    @PostMapping("/login")
    public Result<UserLoginVo> login(@RequestBody UserLoginDto userLoginDto){
        return Result.resp(sysUserService.login(userLoginDto),"账号或密码错误！");
    }

}
